package com.hspedu.homework;

public class HomeWork04 {
    public static void main(String[] args) {

        Manager manager = new Manager("刘金涛", 1000, 30);
        manager.printSal();

        Staff staff = new Staff("高晶晶", 500, 30);
        staff.printSal();

    }
}


class Worker {

    private String name;
    private double salary;
    private int days;

    public Worker(String name, double salary, int days) {
        this.name = name;
        this.salary = salary;
        this.days = days;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    public int getDays() {
        return days;
    }

    public void setDays(int days) {
        this.days = days;
    }

    public void printSal() {}
}


class Manager extends Worker {

    private double level = 1.2;

    public Manager(String name, double salary, int days) {
        super(name, salary, days);
    }

    @Override
    public void printSal() {
        System.out.println(getName() + "经理的工资为：" + (1000 + getSalary() * getDays() * this.level));
    }

}


class Staff extends Worker {

    private double level = 1.0;

    public Staff(String name, double salary, int days) {
        super(name, salary, days);
    }

    @Override
    public void printSal() {
        System.out.println(getName() + "员工的工资为：" + (getSalary() * getDays() * this.level));
    }

}